package name.vaccari.matteo.tai.chat.domain;

import name.vaccari.matteo.tai.chat.domain.Message;
import name.vaccari.matteo.tai.chat.views.ChatView;

import org.junit.Test;
import java.util.*;
import static org.junit.Assert.*;


public class ChatViewTest {

	@Test
	public void shouldReturnRows() throws Exception {
		List<Message> messages = Arrays.asList(new Message("one", "pippo"), new Message("two", "pippo"));
		ChatView view = new ChatView();
		view.setMessages(messages);
		String actual = view.toString();
		String expected = "" +
				"<ul>" +
				"<li>one</li>" +
				"<li>two</li>" +
				"</ul>";
		assertEquals(expected , actual);
	}
}
